package com.healthcare;

	import java.sql.DriverManager;
import java.sql.SQLException;

import java.sql.Connection;
	
	public class DBConnection {
	    //static reference to itself
	    private static DBConnection instance =
	                new DBConnection();
	    String url = "jdbc:mysql://localhost:3306/aimsfirstconsultdb";
	    String user = "root";
	    String password = "";
	    String driverClass = "com.mysql.jdbc.Driver"; 
	   
	    //private constructor
	    public DBConnection() {
	        try {
	        	 
	            Class.forName(driverClass);
	        } catch (ClassNotFoundException e) {
	            e.printStackTrace();
	        }
	    }
	 
	    public static DBConnection getInstance()   {
	        return instance;
	    }
	 
	    public Connection getConnection() throws SQLException,
	    ClassNotFoundException {
	        Connection connection =  DriverManager.getConnection(url, user, password);
	        return connection;
	    }
	}


